<template>
  <div class="spanControl-list" style="width: 100%;margin-left: 0!important;">
    <el-card class="box-card card-head" style="margin: 0px; width: 100%; min-height: 99%">
      <div slot="header" class="clearfix">
        <span>查看订单</span>
      </div>

      <div class="text item">
        <el-form label-position="left" inline class="display-form">
          <!--<el-form-item label="标识">-->
          <!--<span>{{ order.EId }}</span>-->
          <!--</el-form-item>-->
          <!--<el-form-item label="名称">-->
          <!--<span>{{ order.name }}</span>-->
          <!--</el-form-item>-->
          <el-form-item label="订单编号">
            <span>{{ order.orderCode }}</span>
          </el-form-item>
          <el-form-item label="物流编号">
            <span>{{ order.logisticsCode }}</span>
          </el-form-item>
          <!--<el-form-item label="商家">-->
          <!--<span>{{ order.businessId }}</span>-->
          <!--</el-form-item>-->
          <el-form-item label="商家">
            <span>{{ order.businessName }}</span>
          </el-form-item>
          <el-form-item label="总价">
            <span>{{ order.totalPrice }}</span>
          </el-form-item>
          <el-form-item label="下单时间">
            <span>{{ order.orderTime }}</span>
          </el-form-item>
          <el-form-item label="支付时间">
            <span>{{ order.paymentTime }}</span>
          </el-form-item>
          <el-form-item label="更新时间">
            <span>{{ order.updateTime }}</span>
          </el-form-item>
          <el-form-item label="订单状态">
            <span>{{ order.orderStatus }}</span>
          </el-form-item>
          <el-form-item label="收货人姓名">
            <span>{{ order.receiverName }}</span>
          </el-form-item>
          <el-form-item label="收货人电话">
            <span>{{ order.receiverTel }}</span>
          </el-form-item>
          <el-form-item label="收货人地址">
            <span>{{ order.receiverAddress }}</span>
          </el-form-item>
          <!--<el-form-item label="订单评价">-->
          <!--<span>{{ order.evaluationName }}</span>-->
          <!--</el-form-item>-->
          <!--<el-form-item label="订单评价">-->
          <!--<span>{{ order.evaluationId }}</span>-->
          <!--</el-form-item>-->
          <el-form-item label="用户">
            <span>{{ order.employeeName }}</span>
          </el-form-item>
          <!--<el-form-item label="用户">-->
          <!--<span>{{ order.employeeId }}</span>-->
          <!--</el-form-item>-->
          <!--<el-form-item label="备注">-->
          <!--<span>{{ order.remark }}</span>-->
          <!--</el-form-item>-->
          <el-form-item label="创建人">
            <span>{{ order.createId }}</span>
          </el-form-item>
          <el-form-item label="创建时间">
            <span>{{ order.createDatetime }}</span>
          </el-form-item>
          <el-form-item label="修改人">
            <span>{{ order.updateId }}</span>
          </el-form-item>
          <el-form-item label="修改时间">
            <span>{{ order.updateDatetime }}</span>
          </el-form-item>
          <div v-for="item in order.orderItem" style="border-top: #333333 solid 1px">
            <el-form-item label="商品名称">
              <span>{{item.goodName}}</span>
            </el-form-item>
            <el-form-item label="商品价格">
              <span>{{item.goodPrice}}</span>
            </el-form-item>
            <el-form-item label="商品数量">
              <span>{{item.goodAmount}}</span>
            </el-form-item>
            <el-form-item label="总价">
              <span>{{item.totalPrice}}</span>
            </el-form-item>
          </div>
          <div style="border-top: #CC3300 solid 1px">
            <el-form-item label="评价内容">
              <span>{{evaluationContent}}</span>
            </el-form-item>
          </div>
        </el-form>
      </div>
    </el-card>
  </div>
</template>

<script>
  import {OrderService} from './OrderService';

  export default {
    components: {},
    evaluationContent:"",
    data() {
      return {
        order: {},
      }
    },
    methods: {
      findOrderForView(orderId)//查找订单
      {
        OrderService.findOrderForView(orderId).then((resp) => {
          this.order = resp.data;
          this.evaluationContent=this.order.evaluation.evaluationContent;
        }).catch((error) => {
          this.$message({
            type: 'error',
            message: '查询订单出错'
          })
        })
      },
    },
    created() {
      const orderId = this.$route.params.orderId;
      this.findOrderForView(orderId);
    },
  }

</script>
<style scoped lang="scss">

</style>
